<template>
  <div class="dashboard-container">
    <!-- 欢迎区域 -->
    <div class="welcome-section">
      <div class="welcome-content">
        <h1 class="welcome-title">
          <span>控制台</span>
          <div class="welcome-badge">
            <i class="fa fa-bolt"></i>
          </div>
        </h1>
        <div class="welcome-message">
          <p class="greeting">欢迎回来，{{ adminUser?.username || '管理员' }}</p>
          <p class="subtitle">今天是 {{ currentDate }}，祝您工作愉快！</p>
        </div>
      </div>
      <div class="welcome-stats">
        <div class="stat-item">
          <span class="stat-value">{{ getActiveUsers() }}</span>
          <span class="stat-label">今日活跃</span>
        </div>
        <div class="stat-divider"></div>
        <div class="stat-item">
          <span class="stat-value">{{ getNewRegistrations() }}</span>
          <span class="stat-label">新增注册</span>
        </div>
      </div>
    </div>
    
    <!-- 数据概览卡片 -->
    <div class="dashboard-cards">
      <div class="card card-hover" :class="{ 'card-animated': true }">
        <div class="card-icon users-icon">
          <i class="fa fa-users"></i>
        </div>
        <div class="card-content">
          <h3 class="card-title">用户总数</h3>
          <p class="card-number">{{ userCount.toLocaleString() }}</p>
          <span 
            class="card-change"
            :class="userChange > 0 ? 'change-positive' : 'change-negative'"
          >
            <i class="fa" :class="userChange > 0 ? 'fa-arrow-up' : 'fa-arrow-down'"></i>
            {{ userChange > 0 ? '+' : '' }}{{ userChange }}%
          </span>
        </div>
        <div class="card-indicator"></div>
      </div>
      
      <div class="card card-hover" :class="{ 'card-animated': true }">
        <div class="card-icon videos-icon">
          <i class="fa fa-video-camera"></i>
        </div>
        <div class="card-content">
          <h3 class="card-title">视频总数</h3>
          <p class="card-number">{{ videoCount.toLocaleString() }}</p>
          <span 
            class="card-change"
            :class="videoChange > 0 ? 'change-positive' : 'change-negative'"
          >
            <i class="fa" :class="videoChange > 0 ? 'fa-arrow-up' : 'fa-arrow-down'"></i>
            {{ videoChange > 0 ? '+' : '' }}{{ videoChange }}%
          </span>
        </div>
        <div class="card-indicator"></div>
      </div>
      
      <div class="card card-hover" :class="{ 'card-animated': true }">
        <div class="card-icon comments-icon">
          <i class="fa fa-comments"></i>
        </div>
        <div class="card-content">
          <h3 class="card-title">评论总数</h3>
          <p class="card-number">{{ commentCount.toLocaleString() }}</p>
          <span 
            class="card-change"
            :class="commentChange > 0 ? 'change-positive' : 'change-negative'"
          >
            <i class="fa" :class="commentChange > 0 ? 'fa-arrow-up' : 'fa-arrow-down'"></i>
            {{ commentChange > 0 ? '+' : '' }}{{ commentChange }}%
          </span>
        </div>
        <div class="card-indicator"></div>
      </div>
      
      <div class="card card-hover" :class="{ 'card-animated': true }">
        <div class="card-icon views-icon">
          <i class="fa fa-eye"></i>
        </div>
        <div class="card-content">
          <h3 class="card-title">总浏览量</h3>
          <p class="card-number">{{ formatViews(totalViews) }}</p>
          <span 
            class="card-change"
            :class="viewChange > 0 ? 'change-positive' : 'change-negative'"
          >
            <i class="fa" :class="viewChange > 0 ? 'fa-arrow-up' : 'fa-arrow-down'"></i>
            {{ viewChange > 0 ? '+' : '' }}{{ viewChange }}%
          </span>
        </div>
        <div class="card-indicator"></div>
      </div>
    </div>
    
    <!-- 统计图表和活动区域 -->
    <div class="dashboard-grid">
      <!-- 最近活动 -->
      <div class="dashboard-section activity-section">
        <div class="section-header">
          <h2>最近活动</h2>
          <button class="section-action">查看全部</button>
        </div>
        <div class="activity-list">
          <div 
            v-for="activity in recentActivities" 
            :key="activity.id" 
            class="activity-item activity-hover"
          >
            <div class="activity-icon" :class="activity.type">
              <i :class="activity.icon"></i>
              <div class="activity-dot"></div>
            </div>
            <div class="activity-content">
              <p class="activity-text">{{ activity.text }}</p>
              <span class="activity-time">{{ activity.time }}</span>
            </div>
          </div>
        </div>
      </div>
      
      <!-- 快速操作 -->
      <div class="dashboard-section actions-section">
        <div class="section-header">
          <h2>快速操作</h2>
          <span class="section-subtitle">常用功能一键直达</span>
        </div>
        <div class="quick-actions">
          <button class="action-button action-hover" @click="$router.push('/admin/users')">
            <div class="action-icon">
              <i class="fa fa-user-plus"></i>
            </div>
            <span>添加用户</span>
          </button>
          
          <button class="action-button action-hover" @click="$router.push('/admin/videos')">
            <div class="action-icon">
              <i class="fa fa-upload"></i>
            </div>
            <span>上传视频</span>
          </button>
          
          <button class="action-button action-hover" @click="$router.push('/admin/categories')">
            <div class="action-icon">
              <i class="fa fa-plus-circle"></i>
            </div>
            <span>添加分类</span>
          </button>
          
          <button class="action-button action-hover" @click="$router.push('/admin/tags')">
            <div class="action-icon">
              <i class="fa fa-tag"></i>
            </div>
            <span>添加标签</span>
          </button>
        </div>
      </div>
    </div>
    
    <!-- 系统状态和趋势 -->
    <div class="dashboard-grid">
      <!-- 系统状态 -->
      <div class="dashboard-section status-section">
        <div class="section-header">
          <h2>系统状态</h2>
          <span class="system-health">
            <span class="health-dot"></span>
            运行正常
          </span>
        </div>
        <div class="system-status">
          <div class="status-item">
            <div class="status-icon">
              <i class="fa fa-server"></i>
            </div>
            <div class="status-info">
              <span class="status-label">服务器状态</span>
              <span class="status-value status-online">
                <i class="fa fa-check-circle"></i> 在线
              </span>
            </div>
          </div>
          
          <div class="status-item">
            <div class="status-icon">
              <i class="fa fa-database"></i>
            </div>
            <div class="status-info">
              <span class="status-label">数据库状态</span>
              <span class="status-value status-online">
                <i class="fa fa-check-circle"></i> 正常
              </span>
            </div>
          </div>
          
          <div class="status-item">
            <div class="status-icon">
              <i class="fa fa-code-branch"></i>
            </div>
            <div class="status-info">
              <span class="status-label">系统版本</span>
              <span class="status-value">v1.0.0</span>
            </div>
          </div>
          
          <div class="status-item">
            <div class="status-icon">
              <i class="fa fa-history"></i>
            </div>
            <div class="status-info">
              <span class="status-label">最后更新</span>
              <span class="status-value">{{ lastUpdateTime }}</span>
            </div>
          </div>
        </div>
      </div>
      
      <!-- 热门内容 -->
      <div class="dashboard-section trending-section">
        <div class="section-header">
          <h2>热门内容</h2>
          <span class="section-subtitle">最近7天</span>
        </div>
        <div class="trending-list">
          <div v-for="(item, index) in trendingContent" :key="index" class="trending-item trending-hover">
            <div class="trending-rank">{{ index + 1 }}</div>
            <div class="trending-info">
              <h4 class="trending-title">{{ item.title }}</h4>
              <div class="trending-stats">
                <span><i class="fa fa-eye"></i> {{ item.views }}</span>
                <span><i class="fa fa-heart"></i> {{ item.likes }}</span>
              </div>
            </div>
            <div class="trending-change" :class="item.change > 0 ? 'trending-up' : 'trending-down'">
              <i class="fa" :class="item.change > 0 ? 'fa-arrow-up' : 'fa-arrow-down'"></i>
              {{ Math.abs(item.change) }}%
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'DashboardView',
  data() {
    return {
      // 模拟数据
      userCount: 1564,
      userChange: 12.5,
      videoCount: 8923,
      videoChange: 8.3,
      commentCount: 45231,
      commentChange: 15.2,
      totalViews: '2,564,321',
      viewChange: 23.7,
      adminUser: JSON.parse(localStorage.getItem('adminUser')),
      recentActivities: [
        {
          id: 1,
          type: 'user',
          icon: 'fa-user-plus',
          text: '新用户 user1234 注册成功',
          time: '10分钟前',
        },
        {
          id: 2,
          type: 'video',
          icon: 'fa-video',
          text: '视频《Vue3 教程》上传成功',
          time: '30分钟前',
        },
        {
          id: 3,
          type: 'comment',
          icon: 'fa-comment',
          text: '用户 admin 回复了评论',
          time: '1小时前',
        },
        {
          id: 4,
          type: 'system',
          icon: 'fa-cog',
          text: '系统更新完成',
          time: '2小时前',
        },
      ],
      lastUpdateTime: '2024-01-01 12:30:45',
      trendingContent: [
        {
          title: 'Vue3 入门到精通',
          views: '12,543',
          likes: '892',
          change: 28,
        },
        {
          title: 'TypeScript 实战技巧',
          views: '9,876',
          likes: '645',
          change: 15,
        },
        {
          title: '前端性能优化指南',
          views: '7,432',
          likes: '521',
          change: -3,
        },
        {
          title: 'React Hooks 最佳实践',
          views: '6,234',
          likes: '412',
          change: 12,
        },
      ],
    }
  },
  computed: {
    currentDate() {
      const today = new Date()
      return today.toLocaleDateString('zh-CN', {
        year: 'numeric',
        month: 'long',
        day: 'numeric',
        weekday: 'long',
      })
    },
  },
  methods: {
    formatViews(views) {
      return views
    },
    getActiveUsers() {
      // 模拟数据
      return Math.floor(Math.random() * 200) + 100
    },
    getNewRegistrations() {
      // 模拟数据
      return Math.floor(Math.random() * 50) + 10
    },
  },
  metaInfo: {
    title: '控制台 - 视界无界管理',
  },
}
</script>

<style scoped>
/* 全局变量 - 科技感深色主题 */
:root {
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --primary-color: #667eea;
  --secondary-color: #764ba2;
  --success-color: #2ecc71;
  --danger-color: #e74c3c;
  --warning-color: #f39c12;
  --info-color: #3498db;
  --card-bg: #1a1e28;
  --text-primary: #e2e8f0;
  --text-secondary: #a0aec0;
  --border-color: #2d3748;
  --shadow-light: 0 4px 6px rgba(0, 0, 0, 0.3);
  --shadow-medium: 0 10px 15px rgba(0, 0, 0, 0.4);
  --shadow-heavy: 0 15px 35px rgba(0, 0, 0, 0.5);
  --border-radius: 12px;
  --transition-fast: all 0.2s ease;
  --transition-medium: all 0.3s ease;
  --neon-glow: 0 0 10px rgba(102, 126, 234, 0.5), 0 0 20px rgba(102, 126, 234, 0.3);
  --neon-glow-secondary: 0 0 10px rgba(118, 75, 162, 0.5), 0 0 20px rgba(118, 75, 162, 0.3);
  --grid-size: 40px;
  --grid-color: rgba(102, 126, 234, 0.05);
}

.dashboard-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0;
  position: relative;
  background: var(--card-bg);
}

/* 欢迎区域 */
.welcome-section {
  background: linear-gradient(135deg, #0f1423 0%, #1a2340 50%, #131b36 100%);
  padding: 30px 40px;
  border-radius: var(--border-radius);
  margin-bottom: 30px;
  box-shadow: var(--shadow-medium), 0 0 30px rgba(88, 101, 242, 0.3);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(88, 101, 242, 0.3);
}

/* 背景装饰 - 增强科技感光晕 */
.welcome-section::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 80% 20%, rgba(88, 101, 242, 0.2) 0%, transparent 60%);
  animation: rotateBackground 20s linear infinite;
}

/* 科技感电路图案背景 */
.welcome-section::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    /* 主网格线 */
    linear-gradient(rgba(88, 101, 242, 0.15) 1px, transparent 1px),
    linear-gradient(90deg, rgba(88, 101, 242, 0.15) 1px, transparent 1px),
    /* 电路连接点 */
    radial-gradient(circle, rgba(88, 101, 242, 0.3) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size), var(--grid-size) var(--grid-size), 20px 20px;
  background-position: -1px -1px, -1px -1px, -1px -1px;
  opacity: 0.6;
  pointer-events: none;
}

@keyframes rotateBackground {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.welcome-content {
  position: relative;
  z-index: 1;
}

.welcome-title {
  margin: 0 0 15px 0;
  font-size: 36px;
  font-weight: 700;
  color: white;
  display: flex;
  align-items: center;
  gap: 10px;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
  animation: glowText 2s ease-in-out infinite alternate;
}

@keyframes glowText {
  from { text-shadow: 0 0 10px rgba(255, 255, 255, 0.3); }
  to { text-shadow: 0 0 20px rgba(255, 255, 255, 0.6), 0 0 30px rgba(102, 126, 234, 0.4); }
}

.welcome-badge {
  background: rgba(255, 255, 255, 0.2);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  backdrop-filter: blur(10px);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
  animation: pulseGlow 2s infinite;
}

.welcome-message {
  margin-left: 2px;
}

.greeting {
  font-size: 18px;
  margin: 0 0 8px 0;
  opacity: 0.95;
  font-weight: 500;
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.2);
}

.subtitle {
  font-size: 14px;
  margin: 0;
  opacity: 0.85;
}

.welcome-stats {
  display: flex;
  align-items: center;
  gap: 25px;
  background: rgba(255, 255, 255, 0.1);
  padding: 20px 30px;
  border-radius: 12px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: hidden;
}

/* 欢迎统计区域的发光边框 */
.welcome-stats::before {
  content: '';
  position: absolute;
  top: -1px;
  left: -1px;
  right: -1px;
  bottom: -1px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: linear-gradient(45deg, #667eea, transparent, #764ba2) border-box;
  mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  -webkit-mask-composite: xor;
  pointer-events: none;
  animation: borderRotation 4s linear infinite;
}

@keyframes borderRotation {
  0% { background-position: 0% 0%; }
  100% { background-position: 300% 0%; }
}

.stat-item {
  text-align: center;
  position: relative;
  z-index: 1;
}

.stat-value {
  display: block;
  font-size: 28px;
  font-weight: bold;
  color: white;
  margin-bottom: 4px;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
  animation: pulseValue 2s infinite;
}

@keyframes pulseValue {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.9; transform: scale(1.02); }
}

.stat-label {
  font-size: 14px;
  opacity: 0.85;
  color: white;
}

.stat-divider {
  width: 1px;
  height: 40px;
  background: rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

/* 区域标题 */
h2 {
  color: var(--text-primary);
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  position: relative;
  display: inline-block;
  text-shadow: 0 0 5px rgba(102, 126, 234, 0.2);
}

h2::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 40px;
  height: 3px;
  background: var(--primary-gradient);
  border-radius: 3px;
  box-shadow: var(--neon-glow);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.section-action {
  background: transparent;
  border: 1px solid var(--primary-color);
  color: var(--primary-color);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 6px;
  transition: var(--transition-fast);
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.section-action::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.2), transparent);
  transition: left 0.5s;
}

.section-action:hover {
  background: rgba(102, 126, 234, 0.1);
  box-shadow: 0 0 10px rgba(102, 126, 234, 0.3);
}

.section-action:hover::before {
  left: 100%;
}

.section-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
}

/* 数据概览卡片 */
.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 24px;
  margin-bottom: 30px;
}

.card {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 25px;
  box-shadow: var(--shadow-light);
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-color);
  transition: var(--transition-medium);
  backdrop-filter: blur(10px);
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: linear-gradient(var(--grid-color) 1px, transparent 1px),
                    linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
  background-size: calc(var(--grid-size) / 2) calc(var(--grid-size) / 2);
  opacity: 0.3;
  pointer-events: none;
}

.card-hover:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-medium), var(--neon-glow);
  border-color: var(--primary-color);
}

.card-animated::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 150px;
  height: 150px;
  background: radial-gradient(circle, rgba(102, 126, 234, 0.15) 0%, transparent 70%);
  transition: transform 0.3s ease;
}

.card-animated:hover::after {
  transform: scale(1.5);
}

.card-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: white;
  margin-right: 20px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3), 0 0 15px rgba(255, 255, 255, 0.1);
  transition: var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.card-icon::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.card-hover:hover .card-icon {
  transform: scale(1.05);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4), 0 0 20px rgba(255, 255, 255, 0.2);
}

.card-hover:hover .card-icon::before {
  width: 200px;
  height: 200px;
}

.users-icon {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  box-shadow: 0 0 15px rgba(102, 126, 234, 0.5);
}

.videos-icon {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  box-shadow: 0 0 15px rgba(240, 147, 251, 0.5);
}

.comments-icon {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  box-shadow: 0 0 15px rgba(79, 172, 254, 0.5);
}

.views-icon {
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
  box-shadow: 0 0 15px rgba(250, 112, 154, 0.5);
}

.card-content {
  flex: 1;
  position: relative;
  z-index: 1;
}

.card-title {
  color: var(--text-secondary);
  font-size: 14px;
  margin: 0 0 6px 0;
  font-weight: 500;
  opacity: 0.9;
}

.card-number {
  font-size: 32px;
  font-weight: bold;
  color: var(--text-primary);
  margin: 0 0 6px 0;
  letter-spacing: -0.5px;
  text-shadow: 0 0 5px rgba(102, 126, 234, 0.1);
  position: relative;
  display: inline-block;
}

.card-number::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.card-hover:hover .card-number::after {
  opacity: 0.7;
}

.card-change {
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 12px;
  background: rgba(102, 126, 234, 0.05);
}

.change-positive {
  color: var(--success-color);
  background: rgba(46, 204, 113, 0.1);
}

.change-negative {
  color: var(--danger-color);
  background: rgba(231, 76, 60, 0.1);
}

.card-indicator {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 4px;
  background: var(--primary-gradient);
  width: 0;
  transition: width 0.6s ease;
  box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

.card-hover:hover .card-indicator {
  width: 100%;
  animation: indicatorPulse 2s infinite;
}

@keyframes indicatorPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* 网格布局 */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 30px;
  margin-bottom: 30px;
}

/* 区域样式 */
.dashboard-section {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 30px;
  box-shadow: var(--shadow-light);
  border: 1px solid var(--border-color);
  transition: var(--transition-medium);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.dashboard-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: linear-gradient(var(--grid-color) 1px, transparent 1px),
                    linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
  background-size: calc(var(--grid-size) / 2) calc(var(--grid-size) / 2);
  opacity: 0.2;
  pointer-events: none;
}

.dashboard-section:hover {
  box-shadow: var(--shadow-medium), var(--neon-glow);
  border-color: var(--primary-color);
}

/* 最近活动 */
.activity-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  z-index: 1;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  padding: 16px;
  background: linear-gradient(135deg, #e6f0ff 0%, #f0f8ff 100%);
  border-radius: 10px;
  border: 1px solid #b8d8ff;
  transition: var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.activity-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, rgba(102, 126, 234, 0.05), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.activity-hover:hover {
  transform: translateX(5px);
  box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
  border-color: var(--primary-color);
  background: linear-gradient(135deg, #0d1b2a 0%, #1e3a8a 100%) !important;
}

.activity-hover:hover .activity-text {
  color: #ffffff;
}

.activity-hover:hover .activity-time {
  color: #93c5fd;
}

.activity-hover:hover::before {
  opacity: 1;
}

.activity-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: white;
  margin-right: 16px;
  flex-shrink: 0;
  position: relative;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

.activity-icon::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.3s;
}

.activity-hover:hover .activity-icon::after {
  opacity: 1;
}

.activity-dot {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: white;
  border: 2px solid white;
  bottom: -2px;
  right: -2px;
  animation: pulseDot 2s infinite;
  box-shadow: 0 0 10px white;
}

.activity-icon.user {
  background: var(--info-color);
  box-shadow: 0 0 15px rgba(52, 152, 219, 0.5);
}

.activity-icon.video {
  background: var(--danger-color);
  box-shadow: 0 0 15px rgba(231, 76, 60, 0.5);
}

.activity-icon.comment {
  background: var(--success-color);
  box-shadow: 0 0 15px rgba(46, 204, 113, 0.5);
}

.activity-icon.system {
  background: var(--warning-color);
  box-shadow: 0 0 15px rgba(243, 156, 18, 0.5);
}

.activity-content {
  flex: 1;
  position: relative;
  z-index: 1;
}

.activity-text {
  margin: 0 0 6px 0;
  color: #2c3e50;
  font-size: 15px;
  line-height: 1.5;
}

.activity-time {
  font-size: 12px;
  color: #667eea;
  background: rgba(102, 126, 234, 0.1);
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid rgba(102, 126, 234, 0.2);
}

@keyframes pulseDot {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.8; }
  100% { transform: scale(1); opacity: 1; }
}

/* 快速操作 */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  position: relative;
  z-index: 1;
}

.action-button {
  background: linear-gradient(135deg, #e6f0ff 0%, #f0f8ff 100%);
  border: 2px solid #b8d8ff;
  color: #1a56db;
  padding: 20px;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 500;
  transition: var(--transition-medium);
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.action-button::before {
  content: '';
  position: absolute;
  top: -1px;
  left: -1px;
  right: -1px;
  bottom: -1px;
  background: linear-gradient(45deg, transparent, rgba(102, 126, 234, 0.3), transparent);
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s;
}

.action-hover:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 25px rgba(102, 126, 234, 0.4);
  border-color: var(--primary-color);
  background: linear-gradient(135deg, #0d1b2a 0%, #1e3a8a 100%) !important;
  color: #ffffff;
}

.action-hover:hover::before {
  opacity: 1;
}

.action-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background: rgba(102, 126, 234, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 12px;
  transition: var(--transition-fast);
  color: var(--primary-color);
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

.action-hover:hover .action-icon {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  transform: scale(1.1);
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

/* 系统状态 */
.system-health {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--success-color);
  text-shadow: 0 0 10px rgba(46, 204, 113, 0.3);
}

.health-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--success-color);
  animation: pulse 2s infinite;
  box-shadow: 0 0 20px rgba(46, 204, 113, 0.6);
}

@keyframes pulse {
  0% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 20px rgba(46, 204, 113, 0.6);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.2);
    box-shadow: 0 0 30px rgba(46, 204, 113, 0.8);
  }
  100% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 20px rgba(46, 204, 113, 0.6);
  }
}

.system-status {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  z-index: 1;
}

.status-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: linear-gradient(135deg, #e6f0ff 0%, #f0f8ff 100%);
  border-radius: 10px;
  transition: var(--transition-fast);
  border: 1px solid #b8d8ff;
  position: relative;
  overflow: hidden;
}

.status-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
  transition: left 0.5s;
}

.status-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
  border-color: var(--primary-color);
  background: linear-gradient(135deg, #0d1b2a 0%, #1e3a8a 100%) !important;
}

.status-item:hover .status-label,
.status-item:hover .status-value {
  color: #ffffff;
}

.status-item:hover .status-online {
  color: #4ade80;
}

.status-item:hover::before {
  left: 100%;
}

.status-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(102, 126, 234, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--primary-color);
  flex-shrink: 0;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: hidden;
}

.status-icon::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: linear-gradient(45deg, transparent, rgba(102, 126, 234, 0.2), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.status-item:hover .status-icon::after {
  opacity: 1;
}

.status-info {
  flex: 1;
  position: relative;
  z-index: 1;
}

.status-label {
  display: block;
  color: #667eea;
  font-size: 14px;
  margin-bottom: 4px;
}

.status-value {
  font-weight: 600;
  font-size: 15px;
  color: #2c3e50;
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-online {
  color: #27ae60;
}

/* 热门内容 */
.trending-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.trending-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: linear-gradient(135deg, #e6f0ff 0%, #f0f8ff 100%);
  border-radius: 10px;
  transition: var(--transition-fast);
  border-left: 4px solid transparent;
  border: 1px solid #b8d8ff;
  position: relative;
  overflow: hidden;
}

.trending-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, rgba(102, 126, 234, 0.05), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.trending-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
  border-color: var(--primary-color);
  border-left-color: var(--primary-color);
  background: linear-gradient(135deg, #0d1b2a 0%, #1e3a8a 100%) !important;
}

.trending-hover:hover .trending-title {
  color: #ffffff;
}

.trending-hover:hover .trending-stats span {
  color: #93c5fd;
}

.trending-hover:hover::before {
  opacity: 1;
}

.trending-rank {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 14px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

/* 为每个排名设置不同的彩色 */
.trending-item:nth-child(1) .trending-rank {
  background: #ff6b6b;
  color: white;
  box-shadow: 0 0 15px rgba(255, 107, 107, 0.5);
}

.trending-item:nth-child(2) .trending-rank {
  background: #4ecdc4;
  color: white;
  box-shadow: 0 0 15px rgba(78, 205, 196, 0.5);
}

.trending-item:nth-child(3) .trending-rank {
  background: #45b7d1;
  color: white;
  box-shadow: 0 0 15px rgba(69, 183, 209, 0.5);
}

.trending-item:nth-child(4) .trending-rank {
  background: #f7b731;
  color: white;
  box-shadow: 0 0 15px rgba(247, 183, 49, 0.5);
}

.trending-info {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.trending-title {
  margin: 0 0 6px 0;
  font-size: 15px;
  font-weight: 600;
  color: #2c3e50;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: all 0.3s ease;
}

.trending-hover:hover .trending-title {
  color: #667eea;
}

.trending-stats {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: #667eea;
}

.trending-stats span {
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color 0.3s ease;
}

.trending-hover:hover .trending-stats span {
  color: #4a56e2;
}

.trending-change {
  font-size: 14px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.trending-up {
  color: var(--success-color);
  background: rgba(46, 204, 113, 0.1);
  box-shadow: 0 0 10px rgba(46, 204, 113, 0.3);
}

.trending-down {
  color: var(--danger-color);
  background: rgba(231, 76, 60, 0.1);
  box-shadow: 0 0 10px rgba(231, 76, 60, 0.3);
}

/* 响应式设计 - 科技感适配 */
@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  
  .welcome-section {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    box-shadow: var(--shadow-light), var(--neon-glow);
  }
  
  .welcome-stats {
    align-self: stretch;
    justify-content: space-around;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  }
}

@media (max-width: 768px) {
  .dashboard-cards {
    grid-template-columns: 1fr;
  }
  
  .quick-actions {
    grid-template-columns: 1fr;
  }
  
  .dashboard-section {
    padding: 20px;
    box-shadow: var(--shadow-light);
  }
  
  .dashboard-section:hover {
    box-shadow: var(--shadow-medium), var(--neon-glow);
  }
  
  .welcome-section {
    padding: 25px 20px;
  }
  
  .welcome-title {
    font-size: 28px;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
  }
  
  .card-number {
    font-size: 28px;
  }
  
  .welcome-stats {
    flex-direction: column;
    gap: 15px;
    padding: 15px;
    backdrop-filter: blur(8px);
  }
  
  .stat-divider {
    width: 100%;
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.1);
  }
}

@media (max-width: 480px) {
  .dashboard-container {
    padding: 0;
  }
  
  .dashboard-section {
    padding: 16px;
  }
  
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  h2 {
    font-size: 20px;
  }
  
  h2::after {
    width: 30px;
    height: 2px;
  }
  
  .activity-item,
  .trending-item,
  .status-item {
    padding: 12px;
    gap: 12px;
    backdrop-filter: blur(5px);
  }
  
  /* 移动端优化科技感 */
  :root {
    --grid-size: 30px;
    --neon-glow: 0 0 8px rgba(102, 126, 234, 0.4), 0 0 15px rgba(102, 126, 234, 0.2);
  }
}
</style>